<div class="shops view">
<h2><?php  echo __('Shop'); ?></h2>
	<dl>
		<dt><?php echo __('Id'); ?></dt>
		<dd>
			<?php echo h($shop['Shop']['id']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Name'); ?></dt>
		<dd>
			<?php echo h($shop['Shop']['name']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Address'); ?></dt>
		<dd>
			<?php echo h($shop['Shop']['address']); ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Edit Shop'), array('action' => 'edit', $shop['Shop']['id'])); ?> </li>
		<li><?php echo $this->Form->postLink(__('Delete Shop'), array('action' => 'delete', $shop['Shop']['id']), null, __('Are you sure you want to delete # %s?', $shop['Shop']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('List Shops'), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Shop'), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List H Products'), array('controller' => 'h_products', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New H Product'), array('controller' => 'h_products', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Sales'), array('controller' => 'sales', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Sale'), array('controller' => 'sales', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Product Shops'), array('controller' => 'product_shops', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Product Shop'), array('controller' => 'product_shops', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php echo __('Related H Products'); ?></h3>
	<?php if (!empty($shop['HProduct'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Shop Id'); ?></th>
		<th><?php echo __('Product Id'); ?></th>
		<th><?php echo __('Date'); ?></th>
		<th><?php echo __('Purchase Price'); ?></th>
		<th><?php echo __('Quantity'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($shop['HProduct'] as $hProduct): ?>
		<tr>
			<td><?php echo $hProduct['id']; ?></td>
			<td><?php echo $hProduct['shop_id']; ?></td>
			<td><?php echo $hProduct['product_id']; ?></td>
			<td><?php echo $hProduct['date']; ?></td>
			<td><?php echo $hProduct['purchase_price']; ?></td>
			<td><?php echo $hProduct['quantity']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'h_products', 'action' => 'view', $hProduct['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'h_products', 'action' => 'edit', $hProduct['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'h_products', 'action' => 'delete', $hProduct['id']), null, __('Are you sure you want to delete # %s?', $hProduct['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New H Product'), array('controller' => 'h_products', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php echo __('Related Sales'); ?></h3>
	<?php if (!empty($shop['Sale'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('User Id'); ?></th>
		<th><?php echo __('Shop Id'); ?></th>
		<th><?php echo __('Date'); ?></th>
		<th><?php echo __('Ticket Number'); ?></th>
		<th><?php echo __('Description'); ?></th>
		<th><?php echo __('Total'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($shop['Sale'] as $sale): ?>
		<tr>
			<td><?php echo $sale['id']; ?></td>
			<td><?php echo $sale['user_id']; ?></td>
			<td><?php echo $sale['shop_id']; ?></td>
			<td><?php echo $sale['date']; ?></td>
			<td><?php echo $sale['ticket_number']; ?></td>
			<td><?php echo $sale['description']; ?></td>
			<td><?php echo $sale['total']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'sales', 'action' => 'view', $sale['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'sales', 'action' => 'edit', $sale['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'sales', 'action' => 'delete', $sale['id']), null, __('Are you sure you want to delete # %s?', $sale['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Sale'), array('controller' => 'sales', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php echo __('Related Users'); ?></h3>
	<?php if (!empty($shop['User'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Shop Id'); ?></th>
		<th><?php echo __('Username'); ?></th>
		<th><?php echo __('Password'); ?></th>
		<th><?php echo __('Name'); ?></th>
		<th><?php echo __('Role'); ?></th>
		<th><?php echo __('Avatar'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($shop['User'] as $user): ?>
		<tr>
			<td><?php echo $user['id']; ?></td>
			<td><?php echo $user['shop_id']; ?></td>
			<td><?php echo $user['username']; ?></td>
			<td><?php echo $user['password']; ?></td>
			<td><?php echo $user['name']; ?></td>
			<td><?php echo $user['role']; ?></td>
			<td><?php echo $user['avatar']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'users', 'action' => 'view', $user['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'users', 'action' => 'edit', $user['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'users', 'action' => 'delete', $user['id']), null, __('Are you sure you want to delete # %s?', $user['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php echo __('Related Product Shops'); ?></h3>
	<?php if (!empty($shop['productShop'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Shop Id'); ?></th>
		<th><?php echo __('Product Id'); ?></th>
		<th><?php echo __('Minimun Stock'); ?></th>
		<th><?php echo __('Current Stock'); ?></th>
		<th class="actions"><?php echo __('Actions'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($shop['productShop'] as $productShop): ?>
		<tr>
			<td><?php echo $productShop['id']; ?></td>
			<td><?php echo $productShop['shop_id']; ?></td>
			<td><?php echo $productShop['product_id']; ?></td>
			<td><?php echo $productShop['minimun_stock']; ?></td>
			<td><?php echo $productShop['current_stock']; ?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'product_shops', 'action' => 'view', $productShop['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'product_shops', 'action' => 'edit', $productShop['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'product_shops', 'action' => 'delete', $productShop['id']), null, __('Are you sure you want to delete # %s?', $productShop['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Product Shop'), array('controller' => 'product_shops', 'action' => 'add')); ?> </li>
		</ul>
	</div>
</div>
